<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateImagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('images', function (Blueprint $table) {
            $table->bigIncrements('id')->unique()->comment('主键ID');
            $table->string('name')->nullable()->comment('图片名');
            $table->string('url_1')->nullable()->comment('图片地址1');
            $table->string('url_2')->nullable()->comment('图片地址2');
            $table->string('page_path')->nullable()->comment('跳转路径');
            $table->tinyInteger("type")->nullable()->comment("图片类型,1代表tabBar图，2代表Banner图");
            $table->timestamps();
        });

        DB::statement("ALTER TABLE `images` comment '图片信息表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('images');
    }
}
